package com.shape;

public class TestDemo {
    public static void descShape(ShapeInterface s){
        System.out.println("它的周长为：" + s.perimeter() + "，面积为:" + s.area());
    }
    public static void main(String[] args) {
        double[] rArr = {2.8, 2.8};
        Rectangle r1 = new Rectangle(rArr);
        System.out.println("这是一个" + r1.getShape() + "，它的周长为：" + r1.perimeter() + "，面积为:" + r1.area());
        r1.printParams();
        descShape(r1);

        System.out.println("--------------------------------------------------");
        Circle c1 = new Circle();
        c1.radius = 3.0;
        System.out.println("这是一个" + c1.getShape() + "，它的周长为：" + c1.perimeter() + "，面积为:" + c1.area());
        c1.printParams();
        descShape(c1);
    }
}
